Don't only use ch != 0 to check if a character is a control char.
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 16 Mar 2011 23:04:20 +0000 (19:04 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 17 Mar 2011 00:09:14 +0000 (20:09 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=644976

gtk/gtkimcontextsimple.c
gtk/gtkimmulticontext.c

index a68886f9a9b0f1506b5fd4e229d92fd9278c1e17..68f75783636541879722caf35f038afc91c826d4 100644 (file)
@@ -746,7 +746,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
        }
   
       ch = gdk_keyval_to_unicode (event->keyval);
-      if (ch != 0)
+      if (ch != 0 && !g_unichar_iscntrl (ch))
        {
          gtk_im_context_simple_commit_char (context, ch);
          return TRUE;
index f2454fcb4afe746bafab3267c3eb5cdd3018a16e..ea471a8aaf3ed0d7b2a25a741cf422a343debd87 100644 (file)
@@ -355,7 +355,7 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context,
       gunichar ch;
 
       ch = gdk_keyval_to_unicode (event->keyval);
-      if (ch != 0)
+      if (ch != 0 && !g_unichar_iscntrl (ch))
         {
           gint len;
           gchar buf[10];